#include "EWAUIGraphLine.hpp"

namespace Eyer
{
    EWAUIGraphType EWAUIGraphLine::GetType()
    {
        return EWAUIGraphType::LINE;
    }

    int EWAUIGraphLine::Transform(const Vec2I & _xy, const Vec2I & _parentWH)
    {
        int startX = xyStart.x() + _xy.x();
        int startY = xyStart.y() + _xy.y();

        int endX = xyEnd.x() + _xy.x();
        int endY = xyEnd.y() + _xy.y();

        xyStart.x(startX);
        xyStart.y(startY);
        xyEnd.x(endX);
        xyEnd.y(endY);

        return 0;
    }

    bool EWAUIGraphLine::IsValid()
    {
        if(xyStart.y() < 0 && xyEnd.y() < 0){
            return false;
        }
        return true;
    }
}